/*******************************************************************************************
 *  ChangeDirection.c
 *
 *  Creating and managing ChangeDirection object strucutres.
 *
 *******************************************************************************************/







/*******************************************************************************************
 *  INCLUDES :
 *******************************************************************************************/

/* System and library related : */
#include <stdlib.h>
#include <string.h>

/* Project related : */
#include "ChangeDirection.h"







/*******************************************************************************************
 *  FUNCTIONS :
 *******************************************************************************************/

/*******************************************************************************************
 *  NEWCHANGEDIRECTION : Creates an empty ChangeDirection object structure.
 *******************************************************************************************/
ChangeDirection *newChangeDirection(void) {
	ChangeDirection *cd;

	/* Creating the container structure : */
	cd = (ChangeDirection *)malloc(sizeof(ChangeDirection));


	/* Setting the object's type : */
	cd->otype = changeDirection;


	/* Returning the still empty structure : */
	return cd;

}




/*******************************************************************************************
 *  FREECHANGEDIRECTION : destroys an ChangeDirection object structure and all the objects it stores.
 *******************************************************************************************/
void freeChangeDirection(ChangeDirection *cd) {

	free(cd->term);

	free(cd->direction);

	free(cd);

}



/*******************************************************************************************
 *  SETCHANGEDIRECTIONTERM : set the ChangeDirection object's term parameter.
 *******************************************************************************************/
void setChangeDirectionTerm(ChangeDirection *cd, char *t) {
	cd->term = t;
}



/*******************************************************************************************
 *  SETCHANGEDIRECTIONDIRECTION : set the ChangeDirection object's direction.
 *******************************************************************************************/
void setChangeDirectionDirection(ChangeDirection *cd, Direction *d) {
	cd->direction = d;
}
